pull: If built with --disable-http2, allow enabling via http2=1
authorColin Walters <walters@verbum.org>
Tue, 8 Jan 2019 14:41:26 +0000 (09:41 -0500)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 9 Jan 2019 15:04:27 +0000 (15:04 +0000)
We have a `http2=[0|1]` remote config option; let's have the
`--disable-http2` build option define the default for that.  This way
it's easy to still enable http2 for testing even if
we have it disabled by default.

Closes: #1798
Approved by: jlebon

src/libostree/ostree-fetcher-curl.c
src/libostree/ostree-repo-pull.c

index 9738f9808c051f7f9454fe4aca5e6d3324f7780b..294b20781ea00cb0bb1a0020873b20b49e8c0d98 100644 (file)
@@ -777,7 +777,6 @@ initiate_next_curl_request (FetcherRequest *req,
    * there are numerous HTTP/2 fixes since the original version in
    * libcurl 7.43.0.
    */
-#ifdef BUILDOPT_HTTP2
   if (!(self->config_flags & OSTREE_FETCHER_FLAGS_DISABLE_HTTP2))
     {
 #if CURL_AT_LEAST_VERSION(7, 51, 0)
@@ -789,7 +788,7 @@ initiate_next_curl_request (FetcherRequest *req,
       curl_easy_setopt (req->easy, CURLOPT_PIPEWAIT, 1L);
 #endif
     }
-#endif
+
   curl_easy_setopt (req->easy, CURLOPT_WRITEFUNCTION, write_cb);
   if (g_getenv ("OSTREE_DEBUG_HTTP"))
     curl_easy_setopt (req->easy, CURLOPT_VERBOSE, 1L);
index b7eba9d28205160f43e52edcf7c3c047338f0b56..4b596da1f9b2e835a214bcd072480991d6494b65 100644 (file)
@@ -2948,9 +2948,14 @@ _ostree_repo_remote_new_fetcher (OstreeRepo  *self,
   if (gzip)
     fetcher_flags |= OSTREE_FETCHER_FLAGS_TRANSFER_GZIP;
 
-  { gboolean http2 = TRUE;
+  { gboolean http2_default = TRUE;
+#ifndef BUILDOPT_HTTP2
+    http2_default = FALSE;
+#endif
+    gboolean http2;
+
     if (!ostree_repo_get_remote_boolean_option (self, remote_name,
-                                                "http2", TRUE,
+                                                "http2", http2_default,
                                                 &http2, error))
       goto out;
     if (!http2)